﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GLWrap.MathExt;
using Sharp3D.Math.Core;

namespace Test
{
    class Program
    {
        static void Main(string[] args)
        {
            Vector3F axis1 = new Vector3F(2, 5, 9);
            axis1.Normalize();
            Matrix4F m = Matrix4FExtension.RotationMatrix(90, axis1);
            
            QuaternionF q = m.GetQuaternion();

            Vector3F axis = new Vector3F(0,0,0);
            float angle = 0;

            q.GetAxisAndAngle(ref axis,ref angle);

            Console.WriteLine("axis ({0},{1},{2}), angle = {3}", axis.X, axis.Y, axis.Z, angle);
          //  Console.WriteLine("MatOrig = {0}",m.ToString());

            //Console.WriteLine("New Mat = {0}",QuaternionF.QuaternionToMatrix(q));
            Matrix4F m2 = QuaternionF.QuaternionToMatrix(q);

            q = m2.GetQuaternion();

            q.GetAxisAndAngle(ref axis,ref  angle);

            Console.WriteLine("axis ({0},{1},{2}), angle = {3}", axis.X, axis.Y, axis.Z, angle);

            Console.ReadKey();
           // QuaternionF rq = new QuaternionF(
            
        }
    }
}
